package zombiedefense.map;

//declaration for each type of tile
import java.awt.Image;
import static zombiedefense.util.MathEx.loadImageFromJar;

public enum TileType{

    dirt(TileType.dirtImage, false, 'd'),
    grass(TileType.grassImage, false, 'g'),
    graybrick(TileType.graybrickImage, true, 'b'),
    corrugatedmetal(TileType.corrugatedmetalImage, false, 'm'),
    wood(TileType.woodImage, false, 'w');
    
    private Image[] images = {
	loadImageFromJar("/images/dirt.png"),
	loadImageFromJar("/images/grass.png"),
	loadImageFromJar("/images/graybrick.png"),
	loadImageFromJar("/images/corrugatedmetal.png"),
	loadImageFromJar("/images/wood.png")
    };
    
    private static final byte dirtImage = 0;
    private static final byte grassImage = 1;
    private static final byte graybrickImage = 2;
    private static final byte corrugatedmetalImage = 3;
    private static final byte woodImage = 4;
    
    private byte image;
    private boolean solid;
    private char c;

    TileType(byte image, boolean solid, char c) {
	this.image = image;
	this.solid = solid;
	this.c = c;
    }
    
    public Image getImage(){
	return images[image];
    }
    
    public char getChar(){
	return c;
    }
    
    public boolean isSolid(){
	return solid;
    }
}